# @Time    : 2025/1/1 19:42
# @Author  : Zhang Yihao
import os
import sys

from module import func
func()

def open_rw():
    """
    读取文件
    """
    file=open('file2.txt',mode='r+',encoding='utf-8') #文件不存在就会创建，存在就会清空
    text=file.read()
    print(text)
    file.write(' hello world 123')
    file.close()

def use_dir_func():
    file_list=os.listdir()
    print(file_list)
    os.mkdir('dir6')
    os.rmdir('dir3')
    print(os.getcwd())
    os.chdir('dir6')
    file=open('file1','w',encoding='utf-8')
    file.close()

def write_hello(file_path):
    file = open(file_path, mode='w+', encoding='utf-8')
    file.write('python')
    file.close()

if __name__ == '__main__':
    write_hello(sys.argv[1])
    # use_dir_func()